package com.jdd.modules.parkmonthly.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.jdd.common.api.vo.Result;
import com.jdd.modules.parkmonthly.dto.MonthlyDepartmentDto;
import com.jdd.modules.parkmonthly.entity.MonthlyDepartment;
import com.jdd.modules.parkmonthly.entity.MonthlyDepartmentTreeModel;

import java.util.List;

/**
 * @Description: 月卡车部门组织表
 * @Author: jdd
 * @Date: 2021-11-09
 * @Version: V1.0
 */
public interface IMonthlyDepartmentService extends IService<MonthlyDepartment> {

    List<MonthlyDepartmentTreeModel> queryTreeList();

    /**
     * 新增子级
     *
     * @param monthlyDepartmentDto
     * @return
     */
    Result<MonthlyDepartment> addDepartment(MonthlyDepartmentDto monthlyDepartmentDto);

    /**
     * 删除部门/组织
     *
     * @param id
     * @return
     */
    Result<MonthlyDepartment> deleteDepartment(String id);

    boolean verifyOnly(MonthlyDepartmentDto req);

    Result<MonthlyDepartment> removeChildrenData(MonthlyDepartment monthlyDepartment);

    void getTreeData(MonthlyDepartmentTreeModel monthlyDepartmentTreeModel, List<MonthlyDepartmentTreeModel> list);

    void getMonthlyDepartEntity(MonthlyDepartmentDto monthlyDepartmentDto, MonthlyDepartment monthlyDepartment);

    List<MonthlyDepartmentTreeModel> wrapTreeDataToTreeList(List<MonthlyDepartment> firstLevelList);

    /**
     * 根据部门id查询当前部门的所有上级部门并拼接返回
     *
     * @param departmentId
     * @return
     */
    String getDepartmentNameChain(String departmentId);

    /**
     * 递归查询所有父部门
     *
     * @param id
     * @param list
     */
    void getParentDepartment(String id, List<String> list);

    void requestCloudMonthlyDepartment(String parkCode);
}
